<template>
  <div class="FindPage">
    <!-- 顶部 -->
    <div class="FindPageHeader">
      <div>
        <i></i>关注
      </div>
      <div>食谱</div>
      <div>种草社</div>
    </div>
    <div class="follow"></div>
    <div class="followShopName" v-for="{id,imgUrl,title1,title,title2} in followShopName" :key="id">
      <div class="followShopItemsName">
        <div class="followShopItemsName-L">
          <img :src="imgUrl" />
        </div>
        <div class="followShopItemsName-R">
          <span>{{title}}</span>
          <i>{{title1}}</i>
        </div>
      </div>
      <!-- 文字描述 -->
      <div class="followShopItemsNode">{{title2}}</div>
      <!-- 图片 -->
      <div class="followShopItemsImage">
        <div v-for="{id,imgUrl,title} in followShopItemsImage" :key="id">
          <img :src="imgUrl" />
          <span>{{title}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      followShopName: [],
      followShopItemsImage: [],
    };
  },
  created() {
    this.getfollowShopName();
    this.getfollowShopItemsImage();
  },
  methods: {
    async getfollowShopName() {
      const {
        data: { data },
      } = await this.api.getfollowShopName();
      this.followShopName = data;
    },
    async getfollowShopItemsImage() {
      const {
        data: { data },
      } = await this.api.getfollowShopItemsImage();
      this.followShopItemsImage = data;
    },
  },
};
</script>

<style lang="scss" scoped>
.FindPage {
  height: 100%;
  background-color: #f6f6f6;
  .FindPageHeader {
    width: 100%;
    height: 50px;
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    text-align: center;
    z-index: 100;
    > div {
      display: inline-block;
      font-size: 16px;
      padding: 15px 13px;
      height: 20px;
      line-height: 20px;
    }
    > div:nth-child(1) {
      color: #47b34f;
      position: relative;
      > i {
        display: inline-block;
        height: 3px;
        width: 20px;
        background: #47b34f;
        border-radius: 5px;
        position: absolute;
        bottom: 7px;
        left: 33%;
      }
    }
  }
  .follow {
    height: 50px;
    background-color: #f6f6f6;
  }
  .followShopName {
    width: 335px;
    height: 446px;
    margin: 10px 0;
    background-color: #fff;
    padding: 16px 10px;
    border-radius: 8px;
    margin: 10px auto;
    .followShopItemsName {
      height: 42px;
      display: flex;
      .followShopItemsName-L {
        width: 42px;
        height: 42px;
        img {
          width: 100%;
          border-radius: 40px;
        }
      }
      .followShopItemsName-R {
        height: 42px;
        margin-left: 10px;
        > span {
          display: block;
          font-size: 14px;
        }
        > i {
          display: inline-block;
          color: #999;
          margin-top: 3px;
          font-size: 12px;
          font-style: normal;
        }
      }
    }
    .followShopItemsNode {
      height: 48px;
      margin-top: 5px;
      line-height: 24px;
      color: #333;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 16px;
    }
    .followShopItemsImage {
      height: 342px;
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      align-content: space-between;
      > div {
        width: 107px;
        height: 107px;
        margin-right: 2px;
        border: 1px solid #f8f8f8;
        border-radius: 4px;
        position: relative;
        img {
          width: 100%;
          border-radius: 4px;
        }
        > span {
          display: inline-block;
          height: 26px;
          width: 102px;
          position: absolute;
          left: 0;
          bottom: 0;
          background: hsla(0, 0%, 100%, 0.9);
          line-height: 26px;
          padding-left: 5px;
          font-size: 14px;
          color: #ff5757;
        }
      }
    }
  }
}
</style>
